#ifndef SPYNET_NET_APP_BASE_H_
#define SPYNET_NET_APP_BASE_H_

#include "simulate_object.h"
#include "cmd_line_configer.h"

namespace Net
{
	typedef std::map<std::string,  SimulateObject*> SimulateObjectList;

	class AppBase
	{
	public:
		AppBase(){}
		virtual ~AppBase(){} //virtual ~AppBase() = 0;

		virtual void Start(){} //virtual bool Start() = 0;
		virtual bool Tick(){ return true; } //virtual bool Tick() = 0;
		virtual bool IsRunning(){ return true; }

	public:
		void PushSimulateObject( const SimulateObject* sob );
		void PushSimulateObject( int sob_id , const SimulateObject* sob );
		void RemoveSimulateObject( const SimulateObject* sob );
		void RemoveSimulateObject( std::string sob_name );
		void RemoveSimulateObject( int sob_id );

		void AssignCmdLineConfiger( const CmdLineConfiger& configer )
		{
			cmd_line_configer_ = configer;
		}

	private:
		SimulateObjectList simulate_obj_list;
		CmdLineConfiger cmd_line_configer_;
	};
}

#endif